<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>高德地图+热力图</title>
    <link rel="stylesheet" href="../leaflet/leaflet.css"/>
    <script src="../leaflet/leaflet.js"></script>
    <script src="../leaflet.heat-gh-pages/dist/leaflet-heat.js"></script>
    <script src="../data/realworld.10000.js"></script>
    <style>

    </style>

</head>
<body>
<div id="mapid" style="width: 800px; height: 600px;"></div>
<script>

    // 这是热力图真是坐标
    //var mymap = L.map('mapid').setView([-37.87, 175.475], 15);
    var mymap = L.map('mapid').setView([43.86523, 87.47555], 12);

    // 高德地图
    L.tileLayer('http://webrd0{s}.is.autonavi.com/appmaptile?' + 'lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}', {subdomains: ["1", "2", "3", "4"]}).addTo(mymap);

    // 热点图
    addressPoints = addressPoints.map(function (p) { return [p[0], p[1]]; });
    var heat = L.heatLayer(addressPoints).addTo(mymap);

    // 点击事件
    function onMapClick(e) {
        alert("You clicked the map at " + e.latlng);
    }
    mymap.on('click', onMapClick);

</script>
</body>
</html>
